<!DOCTYPE html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<base href="<%=basePath %>"/>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>云谷CMS</title>
    <!--Import Google Icon Font-->
    <!--Import materialize.css-->


    <meta charset="UTF-8">
    <title>Basic CRUD Application - jQuery EasyUI CRUD Demo</title>
    <link rel="stylesheet" type="text/css" href="/lib/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/lib/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="/lib/easyui/themes/color.css">
    <link rel="stylesheet" type="text/css" href="/lib/ztree/css/zTreeStyle/zTreeStyle.css">

    <script type="text/javascript" src="/lib/jquery-1.6.min.js"></script>
    <script type="text/javascript" src="/lib/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/lib/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="/lib/jquery.md5.js"></script>
    <script type="text/javascript" src="/lib/ztree/js/jquery.ztree.all.min.js"></script>
</head>
</head>

<body style="background-color: #0d71bb;">
<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'north'" style="height:100px;border:1px; background-color: #00aced"></div>
    <div data-options="region:'south'" style="height:20px;border: 1px;background-color: #00b5ad"></div>
    <div data-options="region:'west',collapsible:false,split:true" title="系统功能"
         style="width:20%;border: 0px;padding: 0px;">
        <div class="easyui-accordion" data-options="fit:true">
            <div title="CMS发布" style="overflow:auto;padding:10px;">
                <ul id="cmsMenuTree" class="easyui-tree"
                    data-options="url:'/admin/menu/tree/query',method:'get',animate:true"></ul>
            </div>
        </div>
    </div>
    <div data-options="region:'center'" style="width: auto">
        <!--动态Tab -->
        <div id="mainTabs" class="easyui-tabs" data-options="fit:true">
            <div title="首页" style="padding:10px;height: 100%">
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        $('#cmsMenuTree').tree({
            onClick: function (node) {
                var title = node.text;
                if ($('#mainTabs').tabs('exists', title)) {
                    $('#mainTabs').tabs('select', title);
                } else {
                    var menuUrl = node.data.menu_url;
                    if (menuUrl != "" && menuUrl != null) {
                        $('#mainTabs').tabs('add', {
                            title: title,
                            href: node.data.menu_url,
                            closable: true
                        });
                    } else {

                        if (node.children.length == 0) {
                            $('#mainTabs').tabs('add', {
                                title: title,
                                content: "功能建设中",
                                closable: true
                            });
                        }

                    }

                }
            }
        });
    });

</script>
</body>
</html>
